home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
comm
/
tcp
/
ftpd2.lha
/
ftpd2
/
ftp.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-26
|
2KB
|
88 lines
#include <stdio.h>
#include <exec/types.h>
#include <sys/socket.h>
/* Definitions common to both FTP servers and clients */
#define BLKSIZE 2048 /* Chunk size for file I/O */
#define ASCII_TYPE 0
#define IMAGE_TYPE 1
#define LOGICAL_TYPE 2
/* In ftpsubr.c: */
long sendfile (FILE *fp,LONG s,int mode,int hash);
long recvfile (FILE *fp,LONG s,int mode,int hash);
int isbinary (FILE *fp);
// External definitions
extern char *SignOn;
extern char *Userfile;
extern char *curftwin;
extern int LogLevel;
extern char *DefDirCommand;
extern char *ArgDirCommand;
int recvchar(LONG s);
int usputc(LONG s,char c);
int usvprintf(int s,char *fmt, va_list args);
int usprintf(LONG s,char *fmt,...);
int tprintf(char *fmt,...);
int tputc(char c);
int usputs(LONG s,char *x);
int tputs(char *s);
char *pathname(char *cd,char *path);
void ReadConfig(void);
void AddLog(char *fmt,...);
#define CTLZ 26 /* EOF for CP/M systems */
#define IPPORT_FTPD 20 /* FTP data port */
struct ftpserv {
LONG control; /* Control socket */
LONG data; /* Data socket */
LONG pdata; /* Pasave socket */
char type; /* Transfer type */
int logbsize; /* Logical byte size for logical type */
FILE *fp; /* File descriptor being transferred */
struct sockaddr_in port;/* Remote port for data connection */
struct sockaddr_in pasv;/* For Passive Mode */
char *username; /* Arg to USER command */
char *path; /* Allowable path prefix */
LONG perms; /* Permission flag bits */
#define FTP_READ 1 /* Read files */
#define FTP_CREATE 2 /* Create new files */
#define FTP_WRITE 4 /* Overwrite or delete existing files */
#define FTP_MULTIUSER 256 /* Test name with multiuser (and login) */
#define FTP_NOEXTDIR 512 /* Do not use the external dir command for this user */
char *cd; /* Current directory name */
// struct timer tdisc; /* Disconnection timeout timer - WG7J */
};
/* FTP commands */
#define USER_CMD 0
#define ACCT_CMD 1
#define PASS_CMD 2
#define TYPE_CMD 3
#define LIST_CMD 4
#define CWD_CMD 5
#define DELE_CMD 6
#define NAME_CMD 7
#define QUIT_CMD 8
#define RETR_CMD 9
#define STOR_CMD 10
#define PORT_CMD 11
#define NLST_CMD 12
#define PWD_CMD 13
#define XPWD_CMD 14
#define MKD_CMD 15
#define XMKD_CMD 16
#define XRMD_CMD 17
#define RMD_CMD 18
#define STRU_CMD 19
#define MODE_CMD 20
#define PASV_CMD 21